package com.jy.rhin.infra.repo.document.submission.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jy.rhin.domain.document.submission.entity.DocumentAssociationVO;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author dhl
 */
@Data
@NoArgsConstructor
@TableName("t_document_association")
public class DocumentAssociationPO {

    public DocumentAssociationPO(long submissionId, DocumentAssociationVO associationVO) {
        this.id = associationVO.getId();
        this.submissionId = submissionId;
        this.statusCode = associationVO.getStatusCode();
        this.typeCode = associationVO.getTypeCode();
        this.sourceId = associationVO.getSourceId();
        this.sourceStatus = associationVO.getSourceStatus();
        this.targetId = associationVO.getTargetId();
        this.targetStatus = associationVO.getTargetStatus();
    }

    @TableId
    private Long id;
    /**
     * 提交集id
     */
    @TableField("submission_id")
    private Long submissionId;
    /**
     * 可用状态;固定值为 New
     */
    @TableField("status_code")
    private String statusCode;
    /**
     * 关联类型
     */
    @TableField("type_code")
    private String typeCode;
    /**
     * 关联源对象id
     */
    @TableField("source_id")
    private String sourceId;
    /**
     * 关联源对象状态
     */
    @TableField("source_status")
    private String sourceStatus;
    /**
     * 关联目标对象id
     */
    @TableField("target_id")
    private String targetId;
    /**
     * 关联目标对象状态
     */
    @TableField("target_status")
    private String targetStatus;


}
